<?php
session_start();
require '../common/Utility.php';
require '../db/configuration.php';
require '../crud/CustomSecurity.class.php';
require '../crud/Users.class.php';
require '../crud/Userdata.class.php';
require '../crud/Players.class.php';
include_once("../js/ajax/agent.php");
loadDB();
loginCheck();
$agent->init();
isAdmin();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> 
<link rel="stylesheet" type="text/css" href="../css/main.css" />
<link rel="stylesheet" type="text/css" href="../css/page.css" />
<link rel="stylesheet" type="text/css" href="../css/component-product.css" />
<link rel="stylesheet" type="text/css" href="../js/jcarousel/lib/jquery.jcarousel.css" />
<link rel="stylesheet" type="text/css" href="../js/jcarousel/skins/tango/skin.css" />
<link rel="stylesheet" type="text/css" href="../js/fancybox/jquery.fancybox-1.2.5.css" media="screen"/>

<script type="text/javascript" src="../js/jquery-1.4.2.min.js"> </script>
<script type="text/javascript" src="../js/jquery.ui.core.js"> </script>
<script type="text/javascript" src="../js/jquery.easing.1.3.js"> </script>
<script type="text/javascript" src="../js/fancybox/jquery.fancybox-1.2.5.pack.js"></script>
<script type="text/javascript" src="../js/categories.js"></script>
<script type="text/javascript" src="../js/components.js"> </script>
<script type="text/javascript" src="../js/util.js"></script>
<script type="text/javascript" src="../js/slist.js"> </script>
<script type="text/javascript" src="../js/jedit/jquery.jeditable.mini.js"> </script>
<script type="text/javascript" src="../js/quicksand/jquery.quicksand.js"> </script>
<script type="text/javascript" src="../js/quicksand/jquery-animate-css-rotate-scale.js"> </script>



<title>MAIN</title>
</head>
<body>

<?php include("../common/lenta.php"); ?>

<div id="shlist-container">
	<div id="shopping-list"></div>
	<div id="lenta-list"></div>
	<div id="buton-div">
	</div>
</div>



<div id="main">
	
	<div id="product-view">
	<!-- <div id="logo"></div> -->
	<!-- <div id="logo-text"></div> -->
	
	<div id="container">
	<div id="product-view-container">
		<div id="editnew-container"></div>
		<ul id="editnew">
			<li> 
			</li>
			<li>
				<div id="add">
<!--					<a id="fAddButton" class="thickbox" href="add_product.php?iframe">нов продукт</a>-->
				</div>
			</li>
			<li class="find">
<!--				<input id="find" type="text" name="find" onkeyup="filterS();" />-->
			</li>
		</ul>

		<div id="top">
		</div>
		<div id="middle">
		
			<div class="left"></div>
			<div id="content">
				<?php
					$players = new Players(con());
					if(isset($_POST['idm'])){
						$players->inc_goals($_POST['idm']);
					}
					$players = new Players(con());
					list_players($players->getAllClean());
				?>
			</div>
			<!--  <div class="right">
				<div class="scrollbar-top"></div>
				<div class="scrollbar-middle"></div>
				<div class="scrollbar-bottom"></div>
			</div>-->
		</div>
		<div id="bottom">
			<div class="bottomleft">
			</div>
			<div class="bottommiddle">
			</div>
			<div class="bottomright">
			</div>
		</div>
	</div>	
		
	</div>
	</div>
</div>

<script type="text/javascript">
$(document).ready(function(){
	$('a#fAddButton').fancybox({
		'hideOnContentClick': false,
		'showCloseButton':true,
		'frameWidth': 358,
		'frameHeight': 202,
		'padding':0
	});
	resizemain();

	 });

</script>

<?php 
function list_players($table){
	$first = 0;
	echo '<ul>';
	foreach($table as $line){
		echo '<li><form action="goalscorers.php" name="incgoals" method="post" autocomplete="off">';
		echo $line[0].'  |  '.$line[1].'  | '.$line[2].' goals';
		echo '<input type="hidden" id="idm" name="idm" value='.$line[3].'>';
		echo '<input class="table-submit" type="submit" value="Add">';
		echo '</form></li>';
	}
	echo '</ul>';
}
?>

</body>
</html>
